$(function(){
	$(".tiaozheng2").change(function() {
		var $selectedvalue = $("input[name='level']:checked").val();
		if ($selectedvalue =='1') {
			 $('#select').empty();
			 return;
		}if ($selectedvalue =='2') {
			$.ajax({
		        type: "post",
		        url: "manager_getallpowers",
		        data: {level:1},
		        dataType: "json",
		        success: function(data){
		                    $('#select').empty();   //清空select里面的所有内容
		                    var html = ''; 
		                    $.each(eval(data), function(i,msg){
		                    	$("#select").append("<option value="+msg.parent_id+">"+msg.name+"</option>");
		                    });
		                 }
		    });
		}else {
			$.ajax({
		        type: "post",
		        url: "manager_getallpowers",
		        data: {level:2},
		        dataType: "json",
		        success: function(data){
		                    $('#select').empty();   //清空select里面的所有内容
		                    var html = ''; 
		                    $.each(eval(data), function(i,msg){
		                    	$("#select").append("<option value="+msg.parent_id+">"+msg.name+"</option>");
		                    });
		                 }
		    });
		}
	});
})
